package com.ibeeking.found.file.service.common.dos;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 存储信息类
 */
@Data
@TableName("storage")
public class StorageDO implements Serializable {
    private static final long serialVersionUID = -1L;

    @TableId(type = IdType.ASSIGN_ID)
    private Long storageId;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 占用存储大小
     */
    @TableField(value = "storage_size")
    private Long storageSize;

    /**
     * 总存储大小
     */
    @TableField(value = "total_storage_size")
    private Long totalStorageSize;

    /**
     * 修改时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "modify_time")
    private LocalDateTime modifyTime;

    /**
     * 修改用户id
     */
    @TableField(value = "modify_by")
    private Long modifyBy;

    public StorageDO() {

    }

    public StorageDO(Long userId) {
        this.userId = userId;
    }

}
